package com.example.ai.model.data

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query

/**
 * Created by lijinxi on 2024/3/7.
 * @Description:
 */
@Dao
interface MessageDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insertMessage(messageItem: MessageItem)

    @Query("SELECT * FROM messages WHERE chatRoomId = :chatRoomId")
    suspend fun fetchMessage(chatRoomId: String): MessageItem?

}